<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    /**
     * arr.shift()删除数组的第一个元素，并返回其值,length自动减一
     * arr.pop()删除数组的最后一个元素，并返回其值，length自动减一
    */

   var userList = ["zhangsan","lisi","wangwu","zhaoliu"];
   console.log(userList.length);
   var result = userList.shift();
   console.log(result);
   console.log(userList.length);
   var result2 = userList.pop();
   console.log(result2);
   console.log(userList.length);

</script>
</html>